import request from '@/utils/request'

export function getClass(query) {
  return request({
    url: '/api/contract_class/get_all',
    method: 'get'
  })
}

export function getNewClass(query) {
  return request({
    url: '/api/contract_class/get_new_all',
    method: 'get'
  })
}

export function create(data) {
  return request({
    url: '/api/contract_class/create',
    method: 'post',
    data
  })
}

export function createForm(data) {
  return request({
    url: '/api/contract_class/create_top',
    method: 'post',
      data
  })
}

export function del(id){
  return request({
    url: '/api/contract_class/del',
    method: 'get',
    params: { id }
  })
}


export function parentClass(class_id){
  return request({
    url:'/api/contract_class/get_parent',
    method:'get',
    params:{
       class_id:class_id
    }
  })
}


export function get_one_pay(query) {
  return request({
    url: '/api/contract_class/get_open_pay',
    method: 'get',
    params: query
  })
}

export function changeStatus(val, id) {
  return request({
    url: '/api/contract_class/change_status',
    method: 'get',
    params: {
      id: id,
      status: val
    }
  })
}

export function changeShowStatus(val, id) {
  return request({
    url: '/api/contract_class/change_show_status',
    method: 'get',
    params: {
      id: id,
      show_status: val
    }
  })
}
